package demo;

public class Demo02 {
    public static void main(String[] args) {
        int num  = 0x4f057afe;
        int n = 0b1001111000001010111101011111110;
        int n1 = 0b100_1111_0000_0101_0111_1010_1111_1110;
        System.out.println(Integer.toBinaryString(num));
        System.out.println(Integer.toBinaryString(n));
        System.out.println(Integer.toBinaryString(n1));

        System.out.println();
        System.out.println("=====================int======================");
        int min = Integer.MIN_VALUE;
        int max = Integer.MAX_VALUE;
        System.out.println(Integer.toBinaryString(min));
        System.out.println(Integer.toBinaryString(max));

        System.out.println();
        System.out.println("=====================long======================");
        long MIN = Long.MIN_VALUE;
        long MAX = Long.MAX_VALUE;
        System.out.println(Long.toBinaryString(MIN));
        System.out.println(Long.toBinaryString(MAX));

        System.out.println();
        System.out.println("=====================负数======================");
        System.out.println(Integer.toBinaryString(-1));
        System.out.println(Integer.toBinaryString(-7));
        System.out.println(Long.toBinaryString(-7L));


        System.out.println();
        System.out.println("=====================互补现象======================");
        int n2 = -9;
        int m = ~n+1;
        System.out.println("m:"+m);
        System.out.println(Integer.toBinaryString(n2));
        System.out.println(Integer.toBinaryString(~n2));
        System.out.println(Integer.toBinaryString(~n2+1));



    }
}
